#include <iostream>
using namespace std;

int moreOne(int** data, int row, int col) {
	int position = 0;
	for (int i = 0; i < col && position < row; i++) {
		if (data[position][i] == 0) position++;
	}
	return position;
}

int main() {
	int a[5][5] = {{1,1,1,0,0},
				{1,1,0,0,0},
				{1,1,1,0,0},
				{1,1,1,1,0},
				{1,1,1,1,1}};
	int max = 0;
	int position = 0;
	for (int i = 0; i < 5 && position < 5;) {
		if (a[position][i] == 0){
			position++;
		} else {
			max = position;
			i++;
		}
	}
	cout << "position : " << max+1 << endl;
	for (int i = 0; i < 5; i++){
		for (int j = 0; j < 5; j++){
			cout << a[i][j] << "\t";
		}
		cout << endl;	
	}
	return 0;
}

